package com.jokins.admin.vue.hefeng.Controller;


import com.jokins.admin.vue.hefeng.Service.WeatherService;
import com.jokins.admin.vue.hefeng.vo.WeatherVo;
import com.jokins.common.util.ResultData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/hefeng/weather")
public class WeatherController {

    @Autowired
    WeatherService weatherService;

    @GetMapping("/today")
    public ResultData getToDayWeather(@RequestParam String cityId) {
        WeatherVo weatherVo = weatherService.getToDayWeather(cityId);
        return new ResultData("查询成功！",weatherVo);
    }
}
